<template>
	<view class="page">
		<view class="flex benben-position-layout flex flex-wrap align-center examinationRecords_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub examinationRecords_fd0_0'>
				<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  examinationRecords_fd0_0_c0_c0'>&#xE794;</text>
				</view>
				<text class='examinationRecords_fd0_0_c1' v-if="type == 2">考试记录</text>
				<text class='examinationRecords_fd0_0_c1' v-if="type == 3">测试记录</text>
				<view class='flex flex-wrap align-center examinationRecords_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<!---flex布局flex布局开始-->
		<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout examinationRecords_flex_1"
			@tap.stop="handleJumpDiy" data-type="navigateTo"
			:data-url="`/pages/my/chapterExamination/chapterExamination`">
			<template v-for='(item,key0) in dataList'>
				<view class='flex flex-wrap align-center examinationRecords_fd1_0' @tap.stop="handleJumpDiy"
					data-type="navigateTo" :data-url="`/pages/my/chapterExamination/chapterExamination?aid=${item.aid}&type=${type}&name=${item.subject_name}`"
					:key='key0'>
					<image class='examinationRecords_fd1_0_c0' mode="aspectFit" :src='STATIC_URL+"21.png"'></image>
					<text class='flex-sub examinationRecords_fd1_0_c1'>{{item.subject_name}}</text>
					<text class='fu-iconfont2  examinationRecords_fd1_0_c2'>&#xe7f2;</text>
				</view>
			</template>

		</view>
		<!---flex布局flex布局结束-->
		<!---flex布局flex布局开始-->
		<view class="flex flex-wrap align-center justify-center benben-flex-layout" v-if="dataList.length=='0'">
			<benben-empty>
				<view class='flex flex-direction flex-wrap align-center examinationRecords_fd2_0'>
					<image class='examinationRecords_fd2_0_c0' mode="widthFix" :src='STATIC_URL+"76.png"'></image>
					<text class='examinationRecords_fd2_0_c1'>暂无数据</text>

				</view>
			</benben-empty>
		</view>
		<!---flex布局flex布局结束-->

	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				"dataList": [],
				"type": 2,  // 2考试   3测试
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			this.type = options.type;
			this.getDataList()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取考试记录
			async getDataList() {
				//请求方法
				//数据验证

				let dataListData = await this.$api.post(global.apiUrls.post631723f847587, {
					type: this.type == 2 ? 1 : 2
				});
				if (dataListData.data.code != 1) {
					this.$message.info(dataListData.data.msg);
					return
				}
				let dataListinfo = dataListData.data;
				this.dataList = dataListinfo.data
				// console.log(this.dataList)
			}
		}
	};
</script>
<style lang="scss" scoped>
	.examinationRecords_fd2_0 {
		width: 100%;
		padding: 50rpx 0rpx 50rpx 0rpx;
	}

	.examinationRecords_fd2_0_c0 {
		width: 400rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.examinationRecords_fd2_0_c1 {
		padding: 30rpx 0rpx 0rpx 0rpx;
		color: #929292;
	}

	.examinationRecords_fd1_0 {
		background: #fff;
		background-size: 100% !important;
		height: 140rpx;
		padding: 0rpx 32rpx 0rpx 32rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.examinationRecords_fd1_0_c0 {
		width: 88rpx;
		height: 88rpx;
		margin: 0rpx 24rpx 0rpx 0rpx;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
	}

	.examinationRecords_fd1_0_c1 {
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.examinationRecords_fd1_0_c2 {
		font-size: 26rpx;
		font-weight: 500;
		color: #333;
	}

	.examinationRecords_flex_1 {
		margin: 32rpx 32rpx 0rpx 32rpx;
	}

	.examinationRecords_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.examinationRecords_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 36rpx;
	}

	.examinationRecords_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.examinationRecords_fd0_0_c2 {
		width: 36rpx;
		height: 36rpx;
	}

	.examinationRecords_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.page {
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(246, 247, 249, 1);
		background-size: 100% auto !important;
	}
</style>
